{% extends "registration/registration_base.html" %}
{% load i18n %}

{% block title %}{% trans "Log in" %}{% endblock %}

{% block content %}
    <style>
        .form-signin {
            max-width: 330px;
            padding: 15px;
            margin: 0 auto;
        }

        .form-signin .form-signin-heading,
        .form-signin .checkbox {
            margin-bottom: 10px;
        }

        .form-signin .checkbox {
            font-weight: normal;
        }

        .form-signin .form-control {
            position: relative;
            height: auto;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            padding: 10px;
            font-size: 16px;
        }

        .form-signin .form-control:focus {
            z-index: 2;
        }

        .form-signin input[type="email"] {
            margin-bottom: -1px;
            border-bottom-right-radius: 0;
            border-bottom-left-radius: 0;
        }

        .form-signin input[type="password"] {
            margin-bottom: 10px;
            border-top-left-radius: 0;
            border-top-right-radius: 0;
        }
    </style>
    <div class="container">
        <form class="form-signin" action="" method="post">
            {% csrf_token %}
            <h2 class="form-signin-heading">请登录</h2>
            <input type="text" id="inputUsername" class="form-control" name="username" placeholder="username"
                   required=""
                   autofocus="">
            <input type="password" id="inputPassword" class="form-control" name="password" placeholder="Password"
                   required="">
            <div class="checkbox">
                <label>
                    <input type="checkbox" value="remember-me"> Remember me
                </label>
            </div>
            <button class="btn btn-lg btn-primary btn-block" type="submit">{% trans 'Log in' %}</button>
            <p>{% trans "Forgot your password?" %} <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a>.
            </p>
            <p>{% trans "Not a member?" %} <a href="{% url 'registration_register' %}">{% trans "Register" %}</a>.</p>
        </form>
    </div>
{% endblock %}


{% comment %}
**registration/login.html**

It's your responsibility to provide the login form in a template called
registration/login.html by default. This template gets passed four
template context variables:

``form``
    A Form object representing the login form. See the forms
    documentation for more on Form objects.

``next``
    The URL to redirect to after successful login. This may contain a
    query string, too.

``site``
    The current Site, according to the SITE_ID setting. If you don't
    have the site framework installed, this will be set to an instance
    of RequestSite, which derives the site name and domain from the
    current HttpRequest.

``site_name``
    An alias for site.name. If you don't have the site framework
    installed, this will be set to the value of
    request.META['SERVER_NAME']. For more on sites, see The
    "sites" framework.
{% endcomment %}
